package com.xayy.health.ds.service.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.xtck.ha.common.core.domain.R;
import com.xtck.ha.common.core.web.service.dsimpl.BaseServiceImpl;
import com.xtck.ha.common.core.config.DsServerConfig;
import com.xtck.ha.common.core.utils.DomainUtils;
import com.xayy.health.ds.model.DsDiagnosePredictData;
import com.xayy.health.ds.service.DsDiagnosePredictDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import java.util.*;
import java.util.stream.Collectors;


/**
 * @Description: DsDiagnosePredictDataService实现类
 * @Auther:liuyuan
 * @Date:2025-07-09
 */
@Slf4j
@Service
public class DsDiagnosePredictDataServiceImpl extends BaseServiceImpl<DsDiagnosePredictData> implements DsDiagnosePredictDataService {
  /**
  *
  * 冗余代码，为自定义开发DS-Server接口服务
  *
  */
   private static String TABLE_NAME = "TB_DIAGNOSE_PREDICT_DATA";
   private String getUrl(){
      return getDsServerConfig().getUrl();
   }

    /**
     * 删除预测数据根据id
     *
     * @param taskChildIds 子任务id
     */
    @Override
    public void deletePredictDataByIds( List<Long> taskChildIds){
        String sql = "DELETE from HEALTH.tb_diagnose_predict_data\n" +
                "        where task_id in\n (";
        for (long id : taskChildIds){
            sql += id+",";
        }
        if (sql.endsWith(",")) {
            sql = sql.substring(0, sql.length() - 1);
        }
        sql += ");";
        selectBySql(sql);
    }
}
